import {createRouter, createWebHistory} from 'vue-router'
import DefaultLayout from "../views/DefaultLayout";
import Home from "../views/Home";
import Flex from "../views/Flex";
import FlexItem from "../views/FlexItem";
import FlexDemo from "../views/FlexDemo";
import BoxShadow from "../views/BoxShadow";
import Ring from "../views/Ring";
import RingDemo from "../views/RingDemo";

const routes = [
    {
        path: '/',
        redirect: '/layout'
    },
    // {
    //     path: '/hxdp',
    //     name: 'hxdp',
    //     component: import('../views/Hxdp/Hxdp'),
    // },
    {
        path: '/hxdpv2',
        name: 'hxdpv2',
        component: import('../views/Hxdp/Hxdpv2'),
    },
    {
        path: '/layout',
        name: '布局',
        component: DefaultLayout,
        redirect: '/layout/flex',
        children: [
            {
                path: 'flex',
                name: 'flex容器',
                component: Flex,
            },
            {
                path: 'flex-item',
                name: 'flex项目',
                component: FlexItem,
            }
            ,
            {
                path: 'flex-demo',
                name: 'flexDemo',
                component: FlexDemo,
            }
            ,
            {
                path: 'home',
                name: 'home',
                component: Home,
            }
        ]
    },
    {
        path: '/css3',
        name: 'css3',
        component: DefaultLayout,
        redirect: '/css3/box-shadow',
        children: [
            {
                path: 'box-shadow',
                name: 'boxShadow',
                component: BoxShadow,
            }
            ,
            {
                path: 'ring',
                name: '圆环进度条',
                component: RingDemo,
            }
            ,
            {
                path: 'sssss',
                name: 'ssssss',
                component: Home,
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
